<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <title>新建订单</title>
        <link rel="stylesheet" href="__PUBLIC__/Leader/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/Leader/css/index.css" />
        <style type="text/css">
            .order-list a {
                position: relative;
            }
            .order-list span {
                float: right;
                margin-right: 20px;
            }
        </style>
    </head>
    <body>
        <include file="Index/head"/>
        <div class="wrapper main-wrapper wrapper-content ">
            <div class="page-menubar">
                <div class="menu-header">订单管理</div>
                <ul class="order-list">
                    <li <eq name="_GET['statu']" value="0">class="active"</eq>>
                        <a href="{:U('Order/orderadmin',array('statu'=>999))}">待支付 <span class="status0"></span></a>
                    </li>
                    <li <eq name="_GET['statu']" value="1">class="active"</eq>>
                        <a href="{:U('Order/orderadmin',array('statu'=>1))}">未完成 <span class="status0"></span></a>
                    </li>
                    <li <eq name="_GET['statu']" value="2">class="active"</eq>>
                        <a href="{:U('Order/orderadmin',array('statu'=>2))}">已完成 <span class="text-danger status1"></span></a>
                    </li>
                    <li <eq name="_GET['statu']" value="">class="active"</eq>>
                        <a href="{:U('Order/orderadmin')}">全部订单<span class="all"></span></a>
                    </li>
                </ul>
            </div>
            <!--主要内容-->
            <div class="page-content" style="display: block;">
                <!--内容标题-->
                <div class="page-heading" style="position:relative;">
                    <h2>新建订单</h2>
                    <a href="{:U('Order/neworder')}" target="_blank" class="btn btn-primary" style="position:absolute;right: 0;top: 10px;">新建订单</a>
                </div>
                <div class="panel panel-default" style="margin-top: 20px;">
                    <div class="panel-body">
                        <div id="myTabContent" class="tab-content">
                            <div class="tab-pane active in" id="home">
                                <form role="form" name="form">
                                    <div class="form-group">
                                      <label for="name">姓名：</label>
                                      <input type="text" class="form-control" name="name"  onblur="check()" style="width:40%;">
                                      <span class="text-danger hide">姓名不能为空</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">电话：</label>
                                      <input type="text" class="form-control" name="phonenum" onblur="check()" style="width:40%;">
                                      <span class="text-danger hide">电话不能为空</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">人数：</label>
                                      <input type="text" class="form-control" name="peoplenum" onblur="check()" style="width:40%;">
                                      <span class="text-danger hide">人数不能为空</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">发车时间：</label>
                                      <input type="text" class="form-control" name="start_time" onblur="check()" style="width:40%;">
                                      <span class="text-danger hide">发车时间不能为空</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">支付方式：</label>
                                      <select name="pay_type" class="form-control" onblur="check()" style="width:40%;">
                                        <option value="">选择支付方式</option>
                                        <option value="1">个人支付宝</option>
                                        <option value="2">个人微信</option>
                                        <option value="3">线下现金</option>
                                    </select>
                                      <span class="text-danger hide">请选择支付方式</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">票价：</label>
                                      <select name="pay_money" class="form-control" onblur="check()" style="width:40%;">
                                            <option value="">选择票价</option>
                                            <option value="1">100</option>
                                            <option value="2">120</option>
                                            <option value="3">150</option>
                                        </select>
                                        <span class="text-danger hide">请选择票价</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">定金：</label>
                                      <select name="pay_dingjin" class="form-control" onblur="check()" style="width:40%;">
                                        <option value="">选择定金</option>
                                        <option value="1">0</option>
                                        <option value="2">30</option>
                                        <option value="3">50</option>
                                    </select>
                                    <span class="text-danger hide">请选择定金</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">起始地：</label>
                                      <input type="text" class="form-control" name="start_address" onblur="check()" style="width:40%;">
                                      <span class="text-danger hide">起始地不能为空</span>
                                    </div>
                                    <div class="form-group">
                                      <label for="name">目的地：</label>
                                      <input type="text" class="form-control" name="end_address" onblur="check()" style="width:40%;">
                                      <span class="text-danger hide">目的地不能为空</span>
                                    </div>
                                    <div class="form-group">
                                      <button  type="button" class="btn btn-primary" onclick="xinjian()">新建</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script src="__PUBLIC__/Leader/js/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/Leader/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
                            $("[rel=tooltip]").tooltip();
                            $(function () {
                                $('.demo-cancel-click').click(function () {
                                    return false;
                                });
                            });
</script>
<script type="text/javascript">
    is_check = false;
    function xinjian(){
        check();
        if(is_check == true){
           alert("成功") 
        }
    }
    function check(){
        //      乘客姓名
        var name = document.form.name;
        //      乘客电话
	var phone = document.form.phonenum;
        //      乘客人数
        var peoplenum = document.form.peoplenum;
        //      出发时间
	var start_time = document.form.start_time;
        //      支付方式
        var pay_type = document.form.pay_type;
        //      票价
        var pay_money = document.form.pay_money;
        //      支付定金
        var pay_dingjin = document.form.pay_dingjin;
        //      出发地点
        var start_address = document.form.start_address;
        //      到达终点
        var end_address = document.form.end_address;
        if(name.value==""){
//            alert("姓名不能为空");
            name.style.borderColor = 'darkred';
            $(name).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            name.style.borderColor = '#cccccc';
            $(name).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(phone.value==""){
//            alert("电话不能为空");
            phone.style.borderColor = 'darkred';
            $(phone).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            phone.style.borderColor = '#cccccc';
            $(phone).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(peoplenum.value==""){
//            alert("人数不能为空");
            peoplenum.style.borderColor = 'darkred';
            $(peoplenum).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            peoplenum.style.borderColor = '#cccccc';
            $(peoplenum).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(start_time.value==""){
//            alert("出发时间不能为空");
            start_time.style.borderColor = 'darkred';
            $(start_time).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            start_time.style.borderColor = '#cccccc';
            $(start_time).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(pay_type.value==""){
//            alert("请选择支付方式");
            pay_type.style.borderColor = 'darkred';
            $(pay_type).siblings(".text-danger").removeClass("hide").addClass("show");
            console.log($(pay_type).siblings(".text-danger"))
            return false;
        }else{
            pay_type.style.borderColor = '#cccccc';
            $(pay_type).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(pay_money.value==""){
//            alert("请选择票价");
            pay_money.style.borderColor = 'darkred';
            $(pay_money).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            pay_money.style.borderColor = '#cccccc';
            $(pay_money).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(pay_dingjin.value==""){
//            alert("请选择定金");
            pay_dingjin.style.borderColor = 'darkred';
            $(pay_dingjin).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            pay_dingjin.style.borderColor = '#cccccc';
            $(pay_dingjin).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(start_address.value==""){
//            alert("请选择出发地点");
            start_address.style.borderColor = 'darkred';
            $(start_address).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            start_address.style.borderColor = '#cccccc';
            $(start_address).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        if(end_address.value==""){
//            alert("请选择目的地");
            end_address.style.borderColor = 'darkred';
            $(end_address).siblings(".text-danger").removeClass("hide").addClass("show");
            return false;
        }else{
            end_address.style.borderColor = '#cccccc';
            $(end_address).siblings(".text-danger").removeClass("show").addClass("hide");
        }
        is_check=true;
   }
</script>
</html>